package easy;

public class a191_位1的个数 {
    public int hammingWeight(int n) {
        int count = 0;
        for (int i = 0; i < 32; i++) {
            if ((n & (1 << i)) != 0){
                count+=1;
            }
        }
        return count;
    }
}
